/***********************************
* Name: CodeOperacionUnaria.java
* Date: Oct 18, 2010
* @author martin
* Description:
***********************************/

package asmCodeGen;


public class CodeOperacionUnaria implements AsmCode{
    private String opcode;
    private String dir1;
    private boolean tab;
    private boolean comment = false;
    private String text_comment = "";

    /***********************************
     * constructor
     * @param opcode
     * @param dir1
     ***********************************/
    public CodeOperacionUnaria(String opcode, String dir1){
        this.opcode = opcode;
        this.dir1 = dir1;
        tab=true;
    }

    /***********************************
     * constructor
     * @param opcode
     * @param dir1
     ***********************************/
    public CodeOperacionUnaria(String opcode, String dir1, boolean tab){
        this.opcode = opcode;
        this.dir1 = dir1;
        this.tab=tab;
    }

    /***********************************
     * constructor
     * @param opcode
     * @param dir1
     ***********************************/
    public CodeOperacionUnaria(String opcode, String dir1, boolean tab, String text_comment){
        this.opcode = opcode;
        this.dir1 = dir1;
        this.tab=tab;
        this.comment = true;
        this.text_comment = text_comment;
    }

    /***********************************
     * @return the code
     ***********************************/
    public String getCode() {
        return ((tab)?"\t":"")+opcode+"\t"+dir1+((this.comment)?"\t"+";"+this.text_comment:"");
    }
}
